<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta name="Author" content="Douglas P Lau, Marcus Wanner"/>
    <link href="nxt-python.css" rel="stylesheet" type="text/css"/>
    <title>NXT-Python</title>
</head>

<body>
<h1>NXT-Python</h1>

<h2>About</h2>
<p>
    NXT-Python is a package for controlling a LEGO NXT robot using the
    Python programming language.
    It can communicate using either USB or Bluetooth.
    It is available under the Free Software Foundation's GPL license.
    It works on Linux, Windows, and Mac.
    Here's a sample program:
</p>
<pre>
#!/usr/bin/env python

import nxt.locator

brick = nxt.locator.find_one_brick()
name, host, signal_strength, user_flash = brick.get_device_info()
print 'NXT brick name: %s' % name
print 'Host address: %s' % host
print 'Bluetooth signal strength: %s' % signal_strength
print 'Free user flash: %s' % user_flash
</pre>
<h2>Requirements</h2>
<ul>
    <li><a href='http://www.python.org'>Python 2.6</a></li>
    <li>For Bluetooth communication:
        <a href='http://org.csail.mit.edu/pybluez/'>PyBluez</a>
    </li>
    <li>For USB communication:
        <a href='http://sourceforge.net/projects/pyusb/'>PyUSB</a>
    </li>
</ul>
<h2>Download</h2>
<ul>
    <li>Version 1.1<br/>
        &mdash;New motor functions, namely run() and stop().<br/>
        &mdash;Motor braking is finally usable!<br/>
        &mdash;Slightly changed behavior when there are errors searching for a brick.<br/>
        &mdash;New server functionality for light sensor illumination.
    <ul>
        <li><a href='http://NXT-Python.googlecode.com/files/nxt-python-1.1.zip'>nxt-python-1.1.zip</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/nxt-python-1.1.win32.exe'>nxt-python-1.1.win32.exe</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/nxt-python-1.1.win-amd64.exe'>nxt-python-1.1.win-amd64.exe</a>
            source ZIP archive</li>
    </ul>
    </li>
</ul>
<ul>
    <li>Version 1.0<br/>
        &mdash;Experimental support for motor braking.<br/>
        &mdash;Some improvements to the server module, like multiple motor control.
    <ul>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-1.0.zip'>NXT-Python-1.0.zip</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-1.0.win32.exe'>NXT-Python-1.0.win32.exe</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-1.0.win-amd64.exe'>NXT-Python-1.0.win-amd64.exe</a>
            source ZIP archive</li>
    </ul>
    </li>
</ul>
<ul>
    <li>Version 0.9<br/>
        &mdash;Now licensed under the GPLv3 or later.<br/>
        &mdash;Slightly improved accelerometer class.<br/>
        &mdash;A few improvements to nxt.server module.
    <ul>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.9.zip'>NXT-Python-0.9.zip</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.9.win32.exe'>NXT-Python-0.9.win32.exe</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.9.win-amd64.exe'>NXT-Python-0.9.win-amd64.exe</a>
            source ZIP archive</li>
    </ul>
    </li>
</ul>
<ul>
    <li>Version 0.8.1<br/>
        &mdash;Added prelimenary support for accelerometer sensors.<br/>
        &mdash;Important bugfix and some more commands for server.py.
    <ul>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.8.1.zip'>NXT-Python-0.8.1.zip</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.8.1.win32.exe'>NXT-Python-0.8.1.win32.exe</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.8.1.win-amd64.exe'>NXT-Python-0.8.1.win-amd64.exe</a>
            source ZIP archive</li>
    </ul>
    </li>
</ul>
<ul>
    <li>Version 0.8<br/>
        &mdash;Added server module, for a socket-based driver-like command-driven interface.<br/>
        &mdash;Some better help messages.<br/>
        &mdash;Added a logo! Yay!<br/>
        &mdash;More messages when brick.debug is set to 1.
    <ul>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.8.zip'>NXT-Python-0.8.zip</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.8.win32.exe'>NXT-Python-0.8.win32.exe</a>
            source ZIP archive</li>
        <li><a href='http://NXT-Python.googlecode.com/files/NXT-Python-0.8.win-amd64.exe'>NXT-Python-0.8.win-amd64.exe</a>
            source ZIP archive</li>
    </ul>
    </li>
</ul>
<ul>
    <li>Version 0.7<br/>
        &mdash;Added a get_sample() method to CompassSensor class.<br/>
        &mdash;Simplified return values for message_read() method.<br/>
        &mdash;Added message_test.py to examples directory.
    <ul>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.7.zip'>nxt_python-0.7.zip</a>
            source ZIP archive</li>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.7.tar.gz'>nxt_python-0.7.tar.gz</a>
            source tarball</li>
    </ul>
    </li>
</ul>
<ul>
    <li>Version 0.6<br/>
        &mdash;Added nxt.compass module for reading Mindsensors
        compass.<br/>
        &mdash;Added optional "host" and "name" arguments to
        find_bricks and find_one_brick methods. This allows multiple
        bricks to be controlled at the same time. (Thanks to Simon
        Levy!)<br/>
        &mdash;Added null-termination to messages for write_message.
    <ul>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.6.zip'>nxt_python-0.6.zip</a>
            source ZIP archive</li>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.6.tar.gz'>nxt_python-0.6.tar.gz</a>
            source tarball</li>
    </ul>
    </li>
    <li>Version 0.5 &mdash; Fixed timing problem with USB and Ultrasonic
        sensor
    <ul>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.5.zip'>nxt_python-0.5.zip</a>
            source ZIP archive</li>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.5.tar.gz'>nxt_python-0.5.tar.gz</a>
            source tarball</li>
    </ul>
    </li>    
    <li>Version 0.4 &mdash; Improved sensor support + example programs
    <ul>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.4.zip'>nxt_python-0.4.zip</a>
            source ZIP archive</li>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.4.tar.gz'>nxt_python-0.4.tar.gz</a>
            source tarball</li>
    </ul>
    </li>    
    <li>Version 0.3 &mdash; Ultrasonic sensor support added
    <ul>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.3.zip'>nxt_python-0.3.zip</a>
            source ZIP archive</li>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.3.tar.gz'>nxt_python-0.3.tar.gz</a>
            source tarball</li>
    </ul>
    </li>    
    <li>Version 0.2 &mdash; USB support added
    <ul>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.2.zip'>nxt_python-0.2.zip</a>
            source ZIP archive</li>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.2.tar.gz'>nxt_python-0.2.tar.gz</a>
            source tarball</li>
    </ul>
    </li>    
    <li>Version 0.1 &mdash; Initial release
    <ul>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.1.zip'>nxt_python-0.1.zip</a></li>
        <li><a href='http://home.comcast.net/~dplau/nxt_python/download/nxt_python-0.1.tar.gz'>nxt_python-0.1.tar.gz</a></li>
    </ul>
    </li>    
</ul>

<h2>Installation</h2>
<ul>
<li>Either use the executable installer for your platform, or unzip the source and run "python setup.py install" in the same directory as setup.py.
</li>
<li>
For USB on Linux:
<ul>
<li>Create "lego" group, and make your user-id a member</li>
Open a terminal as root, and type:
<pre>groupadd lego</pre>
<pre>usermod -a -G lego [user-id]</pre>
<li>Create a udev rule</li>
Create file at /etc/udev/rules.d/70-lego.rules, containing one line:
<pre>BUS=="usb", SYSFS{idVendor}=="0694", GROUP="lego", MODE="0660"</pre>
</ul></li>
</ul>

<h2>Contact</h2>
<p>
    NXT-Python was written by Douglas P Lau and Marcus Wanner.
    See README file in the package for contact information.
</p>
</body>
</html>
